From 949f6a51febcc600f549da91f7be41094362d305 Mon Sep 17 00:00:00 2001 From: Phaiax Date: Sun, 25 Sep 2016 14:10:01 +0200 Subject: [PATCH] Fix #3107. rustdoc without --target if compiled for host --- src/cargo/ops/cargo_rustc/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/mod.rs b/src/cargo/ops/cargo_rustc/mod.rs index b36ed3ceb..d6ba15480 100644 --- a/src/cargo/ops/cargo_rustc/mod.rs +++ b/src/cargo/ops/cargo_rustc/mod.rs @@ -402,8 +402,10 @@ fn rustdoc(cx: &mut Context, unit: &Unit) -> CargoResult { .cwd(cx.config.cwd()) .arg("--crate-name").arg(&unit.target.crate_name()); - if let Some(target) = cx.requested_target() { - rustdoc.arg("--target").arg(target); + if unit.kind != Kind::Host { + if let Some(target) = cx.requested_target() { + rustdoc.arg("--target").arg(target); + } } let doc_dir = cx.out_dir(unit); -- 2.30.2